*************************************************************************************
***************************************SET WD****************************************
*************************************************************************************	
set more off
cd "~/PATH"

*************************************************************************************
************************************MAIN DOCUMENT************************************
*************************************************************************************
	
* FIGURE 1: IIAs and investor claims for arbitration over time (UNCTAD)
	use dataset1.dta, clear
	twoway (bar iia_cumulative year, yaxis(1) barw(0.8) color(gs5)) ///
	(line isds_annual year, sort yaxis(2) color(gs1) lwidth(medthick) yscale(range(0) axis(2))), ///
	ylabel(0(50)250, labsize(vsmall)) ylabel(0(20)100, axis(2) labsize(vsmall) angle(rvertical)) ///
	xlabel(1957(2)2017, angle(45) labsize(vsmall)) ///
	ytitle("IIAs signed", size(small)) ytitle("ITA claims", axis(2) size(small) orientation(rvertical)) xtitle("") ///
	graphregion(color(white)) legend(off)

*FIGURE 2: GDP per capita (log) ratios in country dyads covered by IIAs
	use dataset2.dta, clear
	twoway (scatter lngdp_cap_poorer lngdp_cap_richer, mcol(gs5) msym(o) msize(tiny) jitter(5)), ///
	graphregion(color(white)) xlabel(5(1)12, labsize(small)) xtitle("Highest GDP per capita (log)", size(small)) ///
	ylabel(5(1)12, labsize(small) nogrid) ytitle("Lowest GDP per capita (log)", size(small))

*FIGURE 3: INDICES TREND LINES
	use dataset3.dta, clear // using all treaties, also non-ISDS ones

	*mean annual values on each index (normalized to 0-1)
	foreach var of varlist scope substantive flexibility precision delegation {
	egen mean`var' = mean(`var'), by(year_signature)
	}

	sort year_signature

	*one graph with all indices
	twoway (line meansubstantive year_signature, lwidth(medium) lpattern(solid) lcolor(gs1)) ///
	(line meanscope year_signature, lwidth(medium) lpattern(dash) lcolor(gs4)) ///
	(line meandelegation year_signature, lwidth(medium) lpattern(longdash) lcolor(gs7)) ///
	(line meanprecision year_signature, lwidth(medium) lpattern("_._.") lcolor(gs10)) ///
	(line meanflexibility year_signature, lwidth(medium) lpattern("--.--.") lcolor(gs13)), ///
	xlabel(1959(3)2016, labsize(vsmall)) ///
	ylabel(0(.1)1, labsize(vsmall) nogrid) ytitle("Index score", size(small)) ///
	xtitle("Year", size(small)) graphregion(color(white)) title("", size(medium) color(gs1)) ///
	legend(lab(1 "Substantive") lab(2 "Scope") lab(3 "Delegation") lab(4 "Precision") lab(5 "Flexibility") row(2))


*FIGURE 4: Coefficient plot, treaty-level analyses. Negative binomial regression models. Whiskers represent 95 percent confidence intervals. Control variables omitted.
	use dataset4.dta, clear

	*estimate models
	nbreg claims substantive flexibility scope precision delegation, vce(robust)
	eststo m1
	
	nbreg claims substantive flexibility scope precision delegation ln_gdp_cap_ratio, vce(robust)
	eststo m2
	
	nbreg claims substantive flexibility scope precision delegation ln_gdp_cap_ratio, exposure(time_inforceP1) vce(robust)
	eststo m3

	*coefplot
	coefplot (m1, lab(Model 1, baseline) msym(circle) msize(small)) ///
	(m2, lab(Model 2, expanded) msym(diamond) msize(small)) ///
	(m3, lab(Model 3, exposure) msym(square) msize(small)), ///
	mcolor(gs1) ciopts(lcolor(gs7) recast(rcap)) legend(row(1)) ///
	drop(ln_gdp_cap_ratio _cons) xline(0, lcolor(gs1)) graphregion(color(white))

*FIGURE 5: Coefficient plot, treaty-country-year-level analyses. Zero-inflated negative binomial regression models.  Whiskers represent 95 percent confidence intervals. Control variables omitted.
	use dataset5.dta, clear

	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m7
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii ///
	v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m8
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii ///
	v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m9
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii ///
	v2xcl_prpty v2x_corr time_inforce i.year i.ccodecow, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m10

	*coefplot
	coefplot (m7, lab(Model 4, baseline) msym(circle) msize(small)) ///
	(m8, lab(Model 5, expanded) msym(diamond) msize(small)) ///
	(m9, lab(Model 6, exposure) msym(square) msize(small)) ///
	(m10, lab(Model 7, country FE) msym(triangle) msize(small)), ///
	mcolor(gs1) ciopts(lcolor(gs7) recast(rcap)) legend(row(2)) ///
	drop(claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr *ccodecow *year _cons) ///
	xline(0, lcolor(gs1)) graphregion(color(white))


*FIGURE 6: Predicted annual count of ISDS claims for different levels of substantive obligation in one IIA. Whiskers represent 95 percent confidence intervals. Other variables held at their mean. Based on Model 6, Figure 5.
	est restore m9
	margins, at(substantive=(0(.1)1)) atmeans
	eststo margins2

	marginsplot, legend(off) graphregion(color(white)) ylabel(0(.005).025, labsize(small)) xlabel(, labsize(small)) ///
	title("") ytitle("Predicted number of ISDS claims", size(small)) xtitle("Substantive obligation", size(small)) ///
	ciopts(msize(medium) lcolor(gs5) lwidth(thin)) plotopts(mcolor(gs1) msize(small) lwidth(thin) lcolor(gs5))

* FIGURE 7: GDP per capita (log) ratios in country dyads covered by IIAs
	use dataset7.dta, clear
	gen time_lapsed = year-year_signature
	egen mean_time_lapsed = mean(time_lapsed), by(year)
	sort year

	twoway (scatter time_lapsed year if year>1994 & year<2018 & time_lapsed<25 , msym(o) jitter(4) mcol(gs5) msize(vsmall)) ///
	(line mean_time year if year>1994 & year<2018, color(gs1) lwidth(medthick) lpattern(solid)), ///
	xlabel(1995(1)2017, labsize(vsmall) angle(45)) ///
	ylabel(5(5)25, labsize(vsmall)) ///
	graphregion(color(white)) legend(lab(1 "ISDS cases") lab(2 "Average age of IIAs used for claim")) ///
	xtitle("Year of registration", size(small)) ytitle("Time lapsed from IIA signed to claim", size(small))



*************************************************************************************
**************************************APPENDICES*************************************
*************************************************************************************

*TABLE C2: Summary statistics, treaty-country-year-level models
	use dataset5.dta, clear

	sutex2 substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal ///
	polconiii v2xcl_prpty v2x_corr ln_gdp_cap_ratio, minmax digits(4) varlabels saving("~/PATH/descriptives.tex") replace

*TABLE C3: Legalisation indices, bivariate correlations
	use dataset3.dta, clear // using all treaties, also non-ISDS ones
	pwcorr scope substantive flexibility precision delegation
	estpost correlate scope substantive flexibility precision delegation, matrix listwise
	esttab using indicies_correlation.tex, unstack not noobs compress nostar label replace cells(b(fmt(2)))

*FIGURES D1-D5: Comparing average substantive obligations scores for ratified and non-ratified IIAs
	use dataset7.dta, clear
	
	*FIGURE D1
	twoway (line meansubst_inforce year_signature, lwidth(medium) lpattern(solid)) ///
	(line meansubst_noforce year_signature, lwidth(medium) lpattern(dash)) if inrange(year_signature,1990,2014), ///
	xlabel(1990(1)2014, labsize(vsmall) angle(45)) ///
	ylabel(0(.1)1, labsize(vsmall) nogrid) ytitle("Substantive obligation index score", size(small)) ///
	xtitle("Year", size(small)) graphregion(color(white)) title("", size(medium) color(gs1)) ///
	legend(lab(1 "Substantive (in force)") lab(2 "Substantive (not in force)") row(1))

	*FIGURE D2
	twoway (line meanflex_inforce year_signature, lwidth(medium) lpattern(solid)) ///
	(line meanflex_noforce year_signature, lwidth(medium) lpattern(dash)) if inrange(year_signature,1990,2014), ///
	xlabel(1990(1)2014, labsize(vsmall) angle(45)) ///
	ylabel(0(.1)1, labsize(vsmall) nogrid) ytitle("Flexibility index score", size(small)) ///
	xtitle("Year", size(small)) graphregion(color(white)) title("", size(medium) color(gs1)) ///
	legend(lab(1 "Flexibility (in force)") lab(2 "Flexibility (not in force)") row(1))

	*FIGURE D3
	twoway (line meanscope_inforce year_signature, lwidth(medium) lpattern(solid)) ///
	(line meanscope_noforce year_signature, lwidth(medium) lpattern(dash)) if inrange(year_signature,1990,2014), ///
	xlabel(1990(1)2014, labsize(vsmall) angle(45)) ///
	ylabel(0(.1)1, labsize(vsmall) nogrid) ytitle("Scope index score", size(small)) ///
	xtitle("Year", size(small)) graphregion(color(white)) title("", size(medium) color(gs1)) ///
	legend(lab(1 "Scope (in force)") lab(2 "Scope (not in force)") row(1))

	*FIGURE D4
	twoway (line meanprecision_inforce year_signature, lwidth(medium) lpattern(solid)) ///
	(line meanprecision_noforce year_signature, lwidth(medium) lpattern(dash)) if inrange(year_signature,1990,2014), ///
	xlabel(1990(1)2014, labsize(vsmall) angle(45)) ///
	ylabel(0(.1)1, labsize(vsmall) nogrid) ytitle("Precision index score", size(small)) ///
	xtitle("Year", size(small)) graphregion(color(white)) title("", size(medium) color(gs1)) ///
	legend(lab(1 "Precision (in force)") lab(2 "Precision (not in force)") row(1))

	*FIGURE D5
	twoway (line meandelegation_inforce year_signature, lwidth(medium) lpattern(solid)) ///
	(line meandelegation_noforce year_signature, lwidth(medium) lpattern(dash)) if inrange(year_signature,1990,2014), ///
	xlabel(1990(1)2014, labsize(vsmall) angle(45)) ///
	ylabel(0(.1)1, labsize(vsmall) nogrid) ytitle("Legal delegation index score", size(small)) ///
	xtitle("Year", size(small)) graphregion(color(white)) title("", size(medium) color(gs1)) ///
	legend(lab(1 "Delegation (in force)") lab(2 "Delegation (not in force)") row(1))

*TABLE E1
	use dataset4.dta, clear

	*estimate models
	nbreg claims substantive flexibility scope precision delegation, vce(robust)
	eststo m1
	
	nbreg claims substantive flexibility scope precision delegation ln_gdp_cap_ratio, vce(robust)
	eststo m2
	
	nbreg claims substantive flexibility scope precision delegation ln_gdp_cap_ratio, exposure(time_inforceP1) vce(robust)
	eststo m3

	*table
	esttab m1 m2 m3 using "~/PATH/main2.tex", tex ///
	replace title("Negative binomial regression models") compress nogaps label constant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 1" "Model 2" "Model 3") ///
	order() drop(lnalpha) cells("b(star fmt(3))"  "se(fmt(3))") 

*TABLE E2
	use dataset5.dta, clear

	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m7
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m8
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m9
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year i.ccodecow, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo m10

	esttab m7 m8 m9 m10 using "~/PATH/main2.tex", tex ///
	replace title("Zero-inflated negative binomial regression models") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 7" "Model 8" "Model 9" "Model 10") ///
	order() drop(*year *ccodecow lnalpha) cells("b(star fmt(3))"  "se(fmt(3))")

*TABLE E3
	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens1
	
	zinb claims flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens2
	
	zinb claims substantive scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens3
	
	zinb claims substantive flexibility  precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens4
	
	zinb claims substantive flexibility scope  delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens5
	
	zinb claims substantive flexibility scope precision  claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens6

	*regression table
	esttab sens1 sens2 sens3 sens4 sens5 sens6 using "~/PATH/robust1.tex", tex ///
	replace title("Zero-inflated negative binomial regression, removing legalization indices one-by-one") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 8" "Model 9" "Model 10" "Model 11" "Model 12" "Model 13") ///
	order() drop(*year lnalpha) cells("b(star fmt(3))"  "se(fmt(3))") 

*TABLEs E4, E5: Zero-inflated negative binomial regression, removing control variables one-by-one
	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens7

	zinb claims substantive flexibility scope precision delegation claims_lag  time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens8

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio  cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens9

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce  lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens10

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all  lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens11

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp  federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens12

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf  polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens13

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal  v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens14

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii  v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens15

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty  i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo sens16

*regression table
esttab sens7 sens8 sens9 sens10 sens11 using "~/PATH/robust2.tex", tex ///
	replace title("Zero-inflated negative binomial regression, removing control variables one-by-one (1)") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 14" "Model 15" "Model 16" "Model 17" "Model 18") ///
	order() drop(*year lnalpha) cells("b(star fmt(3))"  "se(fmt(3))") 

esttab sens12 sens13 sens14 sens15 sens16 using "~/PATH/robust3.tex", tex ///
	replace title("Zero-inflated negative binomial regression, removing control variables one-by-one (2)") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 19" "Model 20" "Model 21" "Model 22" "Model 23" "Model 24") ///
	order() drop(*year lnalpha) cells("b(star fmt(3))"  "se(fmt(3))") 

*TABLE E6: Zero-inflated negative binomial regression, using latent trait legalization indices
	*fix variables
	rename index1_latent scope_latent 
	rename index2_latent substantive_latent 
	rename index3_latent flexibility_latent
	rename index4_latent precision_latent
	rename index5_latent delegation_latent

	label var scope_latent "Scope (latent)" 
	label var substantive_latent "Substantive (latent)"
	label var flexibility_latent "Flexibility (latent)"
	label var precision_latent "Precision (latent)"
	label var delegation_latent "Delegation (latent)"

	*estimate models
	zinb claims substantive_latent flexibility_latent scope_latent precision_latent delegation_latent claims_lag i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt1
	
	zinb claims substantive_latent flexibility_latent scope_latent precision_latent delegation_latent claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr  i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt2
	
	zinb claims substantive_latent flexibility_latent scope_latent precision_latent delegation_latent claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt3
	
	zinb claims substantive_latent flexibility_latent scope_latent precision_latent delegation_latent claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year i.ccodecow, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt4
	
	*regression table
	esttab alt1 alt2 alt3 alt4 using "~/PATH/robust4.tex", tex ///
	replace title("Zero-inflated negative binomial regression, using latent trait legalization indices") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 25" "Model 26" "Model 27" "Model 28") ///
	order() drop(*year *ccodecow lnalpha) cells("b(star fmt(3))"  "se(fmt(3))") 
	

*TABLE E7: Zero-inflated negative binomial regression, using alternative control variables
	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt5
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf v2xel_locreg polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt6
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty cce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt7
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2x_corr gee i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt8
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2x_corr bureaucratic_quality i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt9
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp federal polconiii v2xcl_prpty v2x_corr lnsqrt_fdi_in i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt10
	
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr lntrade_gdp i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo alt11
	
	*regression table
	esttab alt6 alt7 alt8 alt9 alt10 alt11 using "~/PATH/robust5.tex", tex ///
	replace title("Zero-inflated negative binomial regression, using alternative control variables") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 29" "Model 30" "Model 31" "Model 32" "Model 33" "Model 34") ///
	order(substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr) drop(*year lnalpha) cells("b(star fmt(3))"  "se(fmt(3))") 
	
*TABLE E8: Zero-inflated negative binomial regression models with probit
	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) probit
	eststo alt12

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) probit
	eststo alt13

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) probit
	eststo alt14

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year i.ccodecow, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) probit
	eststo alt15
	
	*regression table
	esttab alt12 alt13 alt14 alt15 using "~/PATH/robust6.tex", tex ///
	replace title("Zero-inflated negative binomial regression models with probit") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 35" "Model 36" "Model 37" "Model 38" "Model 39") ///
	order(substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr) drop(*year *ccodecow lnalpha) cells("b(star fmt(3))"  "se(fmt(3))") 
	
*TABLE E9: Ordinary least square regression models
	*estimate models
	regress claims substantive flexibility scope precision delegation claims_lag i.year, vce(cluster treatynumber)
	eststo ols1

	regress claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, vce(cluster treatynumber)
	eststo ols2
	
	regress claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, vce(cluster treatynumber)
	eststo ols3
	
	regress claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year i.ccodecow, vce(cluster treatynumber)
	eststo ols4

	*regression table
	esttab ols1 ols2 ols3 ols4 using "~/PATH/robust7.tex", tex ///
	replace title("Ordinary least square regression models") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 40" "Model 41" "Model 42" "Model 43" "Model 44") ///
	order(substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr) drop(*year *ccodecow) cells("b(star fmt(3))"  "se(fmt(3))") 

*TABLE E10: Zero-inflated negative binomial regression, clustering SEs on respondent
	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag i.year, inflate(ln_gdp_cap_ratio) vce(cluster ccodecow) 
	eststo clu1

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster ccodecow) 
	eststo clu2

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster ccodecow) 
	eststo clu3

	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year i.ccodecow, inflate(ln_gdp_cap_ratio) vce(cluster ccodecow) 
	eststo clu4

	*regression table
	esttab clu1 clu2 clu3 clu4 using "~/PATH/robust8.tex", tex ///
		replace title("Zero-inflated negative binomial regression, clustering SEs on respondent") compress nogaps label noconstant nonumbers ///
		star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 45" "Model 46" "Model 47" "Model 48") ///
		order() drop(*year *ccodecow lnalpha) cells("b(star fmt(3))"  "se(fmt(3))")

*TABLE E11: Zero-inflated negative binomial regression, subst. provs. equal weight
	*estimate models
	zinb claims substantive_eqweight flexibility scope precision delegation claims_lag i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo eqw1

	zinb claims substantive_eqweight flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo  eqw2

	zinb claims substantive_eqweight flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo  eqw3

	zinb claims substantive_eqweight flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year i.ccodecow, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo  eqw4

	*regression table
	esttab eqw1 eqw2 eqw3 eqw4 using "~/PATH/robust9.tex", tex ///
	replace title("Zero-inflated negative binomial regression, subst. provs. equal weight") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 49" "Model 50" "Model 51" "Model 52") ///
	order() drop(*year *ccodecow lnalpha) cells("b(star fmt(3))"  "se(fmt(3))")

*TABLE E12: Zero-inflated negative binomial regression, interacting subst. obligations
	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo inter1

	zinb claims c.substantive##c.v2xcl_prpty flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo inter2

	zinb claims c.substantive##c.v2x_corr flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo inter3

	zinb claims c.substantive##c.lngdp_cap_resp flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngcf federal polconiii v2x_corr v2xcl_prpty time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo inter4

	zinb claims c.substantive##c.lngcf flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp federal polconiii v2x_corr v2xcl_prpty time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo inter5
	
	*regression table
	esttab inter1 inter2 inter3 inter4 inter5 using "~/PATH/robust10.tex", tex ///
	replace title("Zero-inflated negative binomial regression, interacting subst. obligations") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 53" "Model 54" "Model 55" "Model 56" "Model 57") ///
	order(`c.substantive#c.v2xcl_prpty' `c.substantive##c.lngdp_cap_resp') drop(*year lnalpha) cells("b(star fmt(3))"  "se(fmt(3))")

*TABLES E13, E14: Zero-inflated negative binomial regression, removing individual subst. obligations
	*estimate models
	zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub1
	
	zinb claims substantive_no_NT flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub2
	
	zinb claims substantive_no_MFN flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub3
	
	zinb claims substantive_no_FPS flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub4
	
	zinb claims substantive_no_PUAD flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub5
	
	zinb claims substantive_no_EXP flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub6
	
	zinb claims substantive_no_STRIFE flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub7
	
	zinb claims substantive_no_TRANS flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub8
	
	zinb claims substantive_no_PR flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub9
	
	zinb claims substantive_no_UMBR flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub10
	
	zinb claims substantive_no_ENTRY flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub11
	
	zinb claims substantive_no_SM flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub12
	
	zinb claims substantive_no_TRANSP flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub13
	
	zinb claims substantive_no_FET flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo senssub14

	*regression tablesd
	esttab senssub1 senssub2 senssub3 senssub14 senssub4 senssub5 senssub6 using "~/PATH/robust11.tex", tex /// 
	replace title("Zero-inflated negative binomial regression, removing individual subst. obligations (1)") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 58" "Model 59" "Model 60" "Model 61" "Model 62" "Model 63") ///
	drop(*year lnalpha) cells("b(star fmt(3))"  "se(fmt(3))")
	 
	esttab senssub7 senssub8 senssub9 senssub10 senssub11 senssub12 senssub13 using "~/PATH/robust12.tex", tex /// 
	replace title("Zero-inflated negative binomial regression, removing individual subst. obligations (2)") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 64" "Model 65" "Model 66" "Model 67" "Model 68" "Model 69") ///
	drop(*year lnalpha) cells("b(star fmt(3))"  "se(fmt(3))")
	
*TABLE E15: ZINB regression, giving EXP, FET, FPS, UMBR, NT, and PUAD double weight
	*estimate models
	zinb claims substantive_weighted flexibility scope precision delegation claims_lag i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo diw1
	
	zinb claims substantive_weighted flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo  diw2
	
	zinb claims substantive_weighted flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo  diw3
	
	zinb claims substantive_weighted flexibility scope precision delegation claims_lag ln_gdp_cap_ratio cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr time_inforce i.year i.ccodecow, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 
	eststo  diw4

	*regression table	
	esttab diw1 diw2 diw3 diw4 using "~/PATH/robust12.tex", tex ///
	replace title("Zero-inflated negative binomial regression, giving EXP, FET, FPS, UMBR, NTPUAD double weight") compress nogaps label noconstant nonumbers ///
	star(* 0.10 ** 0.05 *** 0.01) mtitle ("Model 72" "Model 73" "Model 74" "Model 75") ///
	order() drop(*year *ccodecow lnalpha) cells("b(star fmt(3))"  "se(fmt(3))")


*FIGURE E1: Density plots for substantive obligation coeffients from series of regressions dropping individual respondent states from the sample one-by-one (jackknife replication). Replications of Model 6 in Table E2 (treaty-country-year level sample, 151 replications).
jackknife _b _se, cluster(treatynumber) saving(jackknife.dta, replace): zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(cluster treatynumber) 

kdensity claims_b_substantive, normal xlabel(2.4(0.05)2.6) ///
graphregion(color(white)) title("") xtitle("") ///
legend(lab(1 "Kernel density") lab(2 "Normal density") row(1)) note("")

*FIGURE E2: Density plots for substantive obligation cofficients from series of regressions dropping individual IIAs from the sample one-by-one (jackknife replication). Replications of Model 6 in Table E2 (treaty-country-year level sample, 2095 replications).
jackknife _b _se, cluster(ccodecow) saving(jackknife2.dta, replace): zinb claims substantive flexibility scope precision delegation claims_lag ln_gdp_cap_ratio time_inforce cum_all lngdp_cap_resp lngcf federal polconiii v2xcl_prpty v2x_corr i.year, inflate(ln_gdp_cap_ratio) vce(robust) 

kdensity claims_b_substantive, normal ///
graphregion(color(white)) title("") xtitle("") xlabel(2.4(0.05)2.6) ///
legend(lab(1 "Kernel density") lab(2 "Normal density") row(1)) note("")
